import 'package:flutter_app/generated/json/base/json_convert_content.dart';
import 'package:flutter_app/bean/problem_check_type_entity.dart';
import 'package:flutter_app/bean/file_path_entity.dart';


ProblemCheckTypeEntity $ProblemCheckTypeEntityFromJson(Map<String, dynamic> json) {
	final ProblemCheckTypeEntity problemCheckTypeEntity = ProblemCheckTypeEntity();
	final List<ProblemCheckTypeProblemTypeList>? problemTypeList = jsonConvert.convertListNotNull<ProblemCheckTypeProblemTypeList>(json['problemTypeList']);
	if (problemTypeList != null) {
		problemCheckTypeEntity.problemTypeList = problemTypeList;
	}
	final List<ProblemCheckTypeProblemTypeList>? taskTypeList = jsonConvert.convertListNotNull<ProblemCheckTypeProblemTypeList>(json['taskTypeList']);
	if (taskTypeList != null) {
		problemCheckTypeEntity.taskTypeList = taskTypeList;
	}
	return problemCheckTypeEntity;
}

Map<String, dynamic> $ProblemCheckTypeEntityToJson(ProblemCheckTypeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['problemTypeList'] =  entity.problemTypeList?.map((v) => v.toJson()).toList();
	data['taskTypeList'] =  entity.taskTypeList?.map((v) => v.toJson()).toList();
	return data;
}

ProblemCheckTypeProblemTypeList $ProblemCheckTypeProblemTypeListFromJson(Map<String, dynamic> json) {
	final ProblemCheckTypeProblemTypeList problemCheckTypeProblemTypeList = ProblemCheckTypeProblemTypeList();
	final List<ChildTypeList>? childTypeList = jsonConvert.convertListNotNull<ChildTypeList>(json['childTypeList']);
	if (childTypeList != null) {
		problemCheckTypeProblemTypeList.childTypeList = childTypeList;
	}
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		problemCheckTypeProblemTypeList.code = code;
	}
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		problemCheckTypeProblemTypeList.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		problemCheckTypeProblemTypeList.name = name;
	}
	final String? pid = jsonConvert.convert<String>(json['pid']);
	if (pid != null) {
		problemCheckTypeProblemTypeList.pid = pid;
	}
	final String? problemCount = jsonConvert.convert<String>(json['problemCount']);
	if (problemCount != null) {
		problemCheckTypeProblemTypeList.problemCount = problemCount;
	}
	final List<ProblemSubmitList>? problemSubmitList = jsonConvert.convertListNotNull<ProblemSubmitList>(json['problemSubmitList']);
	if (problemSubmitList != null) {
		problemCheckTypeProblemTypeList.problemSubmitList = problemSubmitList;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		problemCheckTypeProblemTypeList.type = type;
	}
  if ((int.tryParse(problemCount ?? '0') ?? 0) > 0) {
    problemCheckTypeProblemTypeList.isExist = 0;
    problemCheckTypeProblemTypeList.isExpand.value = true;
  }
	return problemCheckTypeProblemTypeList;
}

Map<String, dynamic> $ProblemCheckTypeProblemTypeListToJson(ProblemCheckTypeProblemTypeList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['childTypeList'] =  entity.childTypeList?.map((v) => v.toJson()).toList();
	data['code'] = entity.code;
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['pid'] = entity.pid;
	data['problemCount'] = entity.problemCount;
	data['problemSubmitList'] =  entity.problemSubmitList?.map((v) => v.toJson()).toList();
	data['type'] = entity.type;
	return data;
}

ChildTypeList $ChildTypeListFromJson(Map<String, dynamic> json) {
	final ChildTypeList childTypeList = ChildTypeList();
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		childTypeList.code = code;
	}
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		childTypeList.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		childTypeList.name = name;
	}
	final String? pid = jsonConvert.convert<String>(json['pid']);
	if (pid != null) {
		childTypeList.pid = pid;
	}
	final String? problemCount = jsonConvert.convert<String>(json['problemCount']);
	if (problemCount != null) {
		childTypeList.problemCount = problemCount;
	}
	final List<ProblemSubmitList>? problemSubmitList = jsonConvert.convertListNotNull<ProblemSubmitList>(json['problemSubmitList']);
	if (problemSubmitList != null) {
		childTypeList.problemSubmitList = problemSubmitList;
	}

	if ((int.tryParse(problemCount ?? '0') ?? 0) > 0) {
		childTypeList.isChoosed.value = true;
	}

	return childTypeList;
}

Map<String, dynamic> $ChildTypeListToJson(ChildTypeList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['pid'] = entity.pid;
	data['problemCount'] = entity.problemCount;
	data['problemSubmitList'] =  entity.problemSubmitList?.map((v) => v.toJson()).toList();
	return data;
}

ProblemSubmitList $ProblemSubmitListFromJson(Map<String, dynamic> json) {
	final ProblemSubmitList problemSubmitList = ProblemSubmitList();
	final String? collectId = jsonConvert.convert<String>(json['collectId']);
	if (collectId != null) {
		problemSubmitList.collectId = collectId;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		problemSubmitList.content = content;
	}
	final String? createBy = jsonConvert.convert<String>(json['createBy']);
	if (createBy != null) {
		problemSubmitList.createBy = createBy;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		problemSubmitList.createTime = createTime;
	}
	final List<FilePathEntity>? fileList = jsonConvert.convertListNotNull<FilePathEntity>(json['fileList']);
	if (fileList != null) {
		problemSubmitList.fileList = fileList;
	}
	final String? groupId = jsonConvert.convert<String>(json['groupId']);
	if (groupId != null) {
		problemSubmitList.groupId = groupId;
	}
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		problemSubmitList.id = id;
	}
	final String? isSelf = jsonConvert.convert<String>(json['isSelf']);
	if (isSelf != null) {
		problemSubmitList.isSelf = isSelf;
	}
	final String? orgId = jsonConvert.convert<String>(json['orgId']);
	if (orgId != null) {
		problemSubmitList.orgId = orgId;
	}
	final String? orgName = jsonConvert.convert<String>(json['orgName']);
	if (orgName != null) {
		problemSubmitList.orgName = orgName;
	}
	final String? problemCode = jsonConvert.convert<String>(json['problemCode']);
	if (problemCode != null) {
		problemSubmitList.problemCode = problemCode;
	}
	final String? problemCodeName = jsonConvert.convert<String>(json['problemCodeName']);
	if (problemCodeName != null) {
		problemSubmitList.problemCodeName = problemCodeName;
	}
	final String? problemId = jsonConvert.convert<String>(json['problemId']);
	if (problemId != null) {
		problemSubmitList.problemId = problemId;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		problemSubmitList.status = status;
	}
	return problemSubmitList;
}

Map<String, dynamic> $ProblemSubmitListToJson(ProblemSubmitList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['collectId'] = entity.collectId;
	data['content'] = entity.content;
	data['createBy'] = entity.createBy;
	data['createTime'] = entity.createTime;
	data['fileList'] =  entity.fileList?.map((v) => v.toJson()).toList();
	data['groupId'] = entity.groupId;
	data['id'] = entity.id;
	data['isSelf'] = entity.isSelf;
	data['orgId'] = entity.orgId;
	data['orgName'] = entity.orgName;
	data['problemCode'] = entity.problemCode;
	data['problemCodeName'] = entity.problemCodeName;
	data['problemId'] = entity.problemId;
	data['status'] = entity.status;
	return data;
}